module;
#include <deque>

export module Code_5_5_1;

template<typename T>
class Stack {
private:
    std::deque<T> elems; // elements
public:
    void push(T const&); // push element
    void pop(); // pop element
    T const& top() const; // return top element
    bool empty() const { // return whether the stack is emptyreturn elems.empty();
    }
    // assign stack of elements of type T2
    template<typename T2>
    Stack& operator= (Stack<T2> const&);
    // to get access to private members of Stack<T2> for any typeT2:
    template<typename> friend class Stack;
};


template<typename T>
template<typename T2>
Stack<T>& Stack<T>::operator= (Stack<T2> const& op2)
{
    elems.clear(); // remove existing elements
    elems.insert(elems.begin(), // insert at the beginning
        op2.elems.begin(), // all elements from op2
        op2.elems.end());
    return *this;
}

export
namespace Code_5_5_1 {

    void run()
    {


    }
}
